using System;

namespace Wrox.ProCSharp.Delegates
{
    public class CarInfoEventArgs(string car) : EventArgs
    {
        public string Car { get; } = car;
    }

    public class CarDealer
    {
        public event EventHandler<CarInfoEventArgs>? NewCarInfo;

        public void NewCar(string car)
        {
            Console.WriteLine($"CarDealer, new car {car}");
            NewCarInfo?.Invoke(this, new CarInfoEventArgs(car));
        }
    }
}